Ext.define('Portal.view.home.Home',{
    extend:'Ext.container.Container',
    alias:'widget.home.home',
    items:[
        {
            xtype: 'textfield',
            fieldLabel: '发送信息',
            id:'text'
        },
        {
            xtype:'button',
            text:'确定发送',
            handler:function () {
                var obj = {
                    id:'pages.postMessage',
                    message:Ext.getCmp('text').getValue() ||'测试信息',
                    targetOrigin:'http://127.0.0.1:1234'
                };
                Ext.fireEvent('postMessage',obj,function (event) {
                    Ext.getCmp('label').setHtml(event.data);
                });
            }
        },
        {
            xtype: 'label',
            text: '',
            id:'label'
        }
    ],
    listeners:{
        render:function () {

        }
    }
});
